package com.codeoss.module.stock.pagebean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.codeoss.framework.context.YunContext;
import com.codeoss.framework.view.component.Message;
import com.codeoss.framework.view.pagebean.FormViewPageBean;
import com.codeoss.module.stock.model.StockMovementConfirm;
import com.codeoss.module.stock.service.IStockMovementConfirmService;

@Service
public class StockMovementFormViewPageBean extends FormViewPageBean {
	@Autowired
    private IStockMovementConfirmService stockMovementConfirmService;
	
	@Transactional
	public void generateStockMovementConfirm() {
		// TODO Auto-generated method stub
		YunContext yunContext=YunContext.getCurrentContext();
		Long keyValue=(Long)getCurrentKeyValue();
		StockMovementConfirm stockMovementConfirm=stockMovementConfirmService.generateConfirm(keyValue);
		yunContext.addMessage(new Message("生成调拨确认单 单据号"+stockMovementConfirm.getDocumentNo()));
	}
}
